package face.pay.web.com.applyment.wx;

import face.pay.common.enterprise.service.IMchMediaBaseServcice;
import face.pay.entity.MchApplymentInfo;
import face.pay.entity.UserInfo;
import face.pay.system.annotation.CurrentUser;
import face.pay.util.ResultMessage;
import face.pay.util.page.PageData;
import face.pay.util.page.PageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: zkj
 * @Date: 2019/9/2 09:48
 * @Description: 商家进件查询 列表展示 状态查询
 */
@Controller
@RequestMapping("/mch_applyment")
public class WxApplyMentQueryConteoller {

    @Autowired
    private IMchMediaBaseServcice iMchMediaServcice;

    /**
     * 代理哦商入口
     * 查看商家进件记录
     * @return
     */
    @RequestMapping("/list")
    public String applyMentList(@CurrentUser UserInfo loginUser, Integer mchUserId, Model model){

        model.addAttribute("mchUserId",mchUserId);

        return  "agency/enterprise/applyment/WxApplymentList";
    }

    @RequestMapping("/queryData")
    @ResponseBody
    public PageData queryList(@CurrentUser UserInfo loginUser,Integer mchUserId,  PageParam pageParam){

        MchApplymentInfo mchApplymentInfo =  new MchApplymentInfo();

        mchApplymentInfo.setOemId(loginUser.getOemId());
        mchApplymentInfo.setUserId(mchUserId);

        return this.iMchMediaServcice.queryPage(mchApplymentInfo,pageParam,loginUser);
    }


    @RequestMapping("/checkStatus")
    @ResponseBody
    public ResultMessage checkStatus(@CurrentUser UserInfo loginUser, Integer applyId){

        MchApplymentInfo mchApplymentInfo =  new MchApplymentInfo();

        mchApplymentInfo.setOemId(loginUser.getOemId());
        mchApplymentInfo.setId(applyId);

        return this.iMchMediaServcice.checkStatus(mchApplymentInfo,loginUser);

    }












}
